package com.soul.controller;

import com.soul.soulcommon.dto.LoginRequest;
import com.soul.soulcommon.dto.RegisterRequest;
import com.soul.soulcommon.result.Result;
import com.soul.soulservice.service.imp.DoctorServiceImp;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/user/doctor")
@Tag(name = "用户服务接口")
public class DoctorController {
    @Autowired
    private DoctorServiceImp doctorService;
    @Operation(summary = "医生登录")
    @PostMapping("/login")
    public Result login(@RequestBody LoginRequest request)
    {
        String login = doctorService.login(request);
        return Result.success("登录成功", login);
    }
    @PostMapping("/register")
    @Operation(summary = "医生注册", description = "通过json传递给接口")
    public Result<String> register(@RequestBody RegisterRequest registerRequest) {
        return doctorService.register(registerRequest);
    }
}
